/**
 * 
 */
package ru.athena.runTool;

import javax.swing.tree.TreePath;

import ru.athena.runTool.Model.CompositeNode;
import ru.athena.runTool.Model.LeafNode;
import ru.athena.runTool.Model.Operation;

public class OperationShowProgress implements Operation {
	RunToolView		view_;
	
	/**
	 * @param view_
	 */
	public OperationShowProgress(RunToolView view) {
		this.view_ = view;
	}

	/**
	 * send an event to view about starting node processing
	 */
	public void visit(CompositeNode node) throws Exception {
		visit( (LeafNode)node );
	}

	/**
	 * send an event about starting node processing
	 */
	public void visit(LeafNode node) throws Exception {
		view_.setSelectedNode( new TreePath( node.getPath()) );
		view_.addStatusText( LogWriter.extractText() );
	}

}